home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
SCHEME
/
GNU
/
SCM4E1
/
!Scm
/
scm
/
macros
< prev
next >
Wrap
Text File
|
1994-04-18
|
342b
|
25 lines
;
; Simple examples of macros
; ams 14/4/94
;
(define c
(procedure->macro
(lambda (x env) `(define ,(cadr x) ,(caddr x)))
)
)
;
; Now try (c r 5) and then accessing r
; also (c a2 (lambda (x)(+ x 2))) and (a2 4)
;
(define lise-args
(procedure->macro
(lambda (x env) `(lambda () ,(cdr x)))
)
)
;
; try (lise-args (+ 2 4) (+ 5 6))
;